<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/11/16
 * Time: 12:02
 */
namespace fastpay;
class Config
{
    public static function config()
    {
        return $config = array(
            # 商户号
            'mid'=>'100211701160001', //10096905  100211701160001
            # 异步通知地址
            'notify_url'=> ADMIN_URL."/v1/notify/bank_notify",
            # 同步跳转
            'return_url' => WEB_URL."rechargeRecord",
            # 私钥证书密码
            'cert_pwd'=>'123456',
            # 私钥文件
            'pri_key_path' => '../extend/sandpay/cert/MID_RSA_PRIVATE_KEY_100211701160001.pfx',
            # 公钥文件
            'pub_key_path'=>"../extend/sandpay/cert/sand.cer",
            # 请求接口
            'api_host'=>'https://cashier.sandpay.com.cn/gateway/api'
        );
    }

    /**
     * @param $method
     * @param $productId
     * @param $channelType
     * @return array
     */
    public static function head($method,$productId,$channelType)
    {
        return $head = array(
            'version' => '1.0',
            'method' => $method, #接口名称
            'productId' => $productId,#产品编码
            'accessType' => '1',#接入类型：1=>普通用户 2=>平台商户
            'mid' => self::config()['mid'],#商户号
            'channelType' => $channelType,#渠道类型： 07=互联网 08=移动端
            'reqTime' => date('YmdHis', time())#请求时间
        );
    }

}